package com.authine.cloudpivot.ext.enums.report;

import io.swagger.annotations.Api;

import java.util.Arrays;

@Api("报表格式类型")
public enum ReportType {
    Pdf("pdf", "application/pdf"),
    Xls("xls", "application/vnd.ms-excel"),
    Xlsx("xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),
    //    Word("doc", "application/msword"),
    Docx("docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"),
    //    Ppt("ppt", "application/vnd.ms-powerpoint"),
    Pptx("pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation"),
    Html("html", "text/html");

    private final String id;
    private final String name;

    ReportType(String id, String name) {

        this.id = id;
        this.name = name;
    }

    public static ReportType get(String id) {

        return Arrays.stream(ReportType.values()).filter(v -> v.id.equals(id)).findFirst().orElse(null);
    }

    public String getId() {
        return this.id;
    }

    public String getName() {
        return this.name;
    }
}
